#!/usr/bin/make -f

build: build-stamp
build-stamp:
	dh_testdir
#	$(MAKE) MAKEARGS=-j4

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
#	$(MAKE) distclean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install
	$(MAKE) install DESTDIR=$(CURDIR)/debian/btkeyboard

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdebconf -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdebconf -a
	dh_installinit
	# Sort countries (including in translations)
	# MUST be after dh_installdebconf
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_builddeb -a
	aegis-deb-add -control debian/btkeyboard/DEBIAN/control .. debian/btkeyboard.aegis=_aegis

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
